package br.game {
	import mx.controls.Alert;
	import mx.controls.Image;
	import mx.controls.ProgressBar;
	import mx.effects.IAbstractEffect;

	public class GameComponent extends Image {
		
		private var user:int;
		private var nameC:String;
		private var type:String;
		private var image:String;
		private var life:int;
		private var damage:int = 0;
		private var attack:int;
		private var range:int;
		private var cost:int;
		private var size:int;
		private var travel:int;
		private var point:int;
		
		public function GameComponent(dados:String) {
			this.width = 50;
			this.height = 50;
			this.z = 10;	
			
			var dados_arr:Array = dados.split(";");
			
			this.user = dados_arr[0];
			this.nameC = dados_arr[1];
			this.type = dados_arr[2];
			this.image = dados_arr[3];
			this.life = dados_arr[4];
			this.damage = dados_arr[5];
			this.attack = dados_arr[6];
			this.range = dados_arr[7];
			this.cost = dados_arr[8];
			this.size = dados_arr[9];
			this.travel = dados_arr[10];
			this.point = dados_arr[11];	
			this.id = dados_arr[12];
			
			this.setImage("images/" + this.image);
			
			
			
			
			/*
			var prg:ProgressBar = new ProgressBar();
			prg.label = "";
			prg.minimum = 0;
			prg.maximum = 100;
			prg.setProgress(150, 100);
			this.addChild(prg);
			*/
			
			
			
		}
		
		public function setPosition(x:int, y:int):void {
			this.x = x;
			this.y = y;
		}
		
		public function setImage(src:String):void {
			this.source = src;			
		}
			
		public function getUser():int {
			return this.user;
		}
		
		public function getName():String {
			return this.nameC;
		}
		
		public function getType():String {
			return this.type;
		}
		
		public function getLife():int {
			return this.life;	
		}
		
		public function getDamage():int {
			return this.damage;
		}
		
		public function getAttack():int {
			return this.attack;
		}
		
		public function getRange():int {
			return this.range;
		}
		
		public function getCost():int {
			return this.cost;
		}
		
		public function getSize():int {
			return this.size;
		}
		
		public function getTravel():int {
			return this.travel;
		}
		
		public function getPoint():int {
			return this.point;
		}
		
	}
	
	
}